package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品SKU
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods_sku")
public class GoodsSku extends Model<GoodsSku> {

    private static final long serialVersionUID=1L;

    /**
     * SKUID
     */
    @TableId(value = "sku_id", type = IdType.AUTO)
    private Integer skuId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * SKU编码
     */
    private String skuCode;

    /**
     * SKU属性,SKU属性KV值对字符串
     */
    private String skuProperties;

    /**
     * SKU外部编码
     */
    private String skuOuterId;

    /**
     * 规格名称
     */
    private String specName;

    /**
     * 吊牌价
     */
    private BigDecimal tagPrice;

    /**
     * 采购价
     */
    private BigDecimal purchasePrice;

    /**
     * 折扣价
     */
    private BigDecimal discountPrice;

    /**
     * 会员价
     */
    private BigDecimal memberPrice;

    /**
     * 创建时间
     */
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    private LocalDateTime gmtModified;


    @Override
    protected Serializable pkVal() {
        return this.skuId;
    }

    @Override
    public String toString() {
        return "GoodsSku{" +
        "skuId=" + skuId +
        ", goodsId=" + goodsId +
        ", skuCode=" + skuCode +
        ", skuProperties=" + skuProperties +
        ", skuOuterId=" + skuOuterId +
        ", specName=" + specName +
        ", tagPrice=" + tagPrice +
        ", purchasePrice=" + purchasePrice +
        ", discountPrice=" + discountPrice +
        ", memberPrice=" + memberPrice +
        ", gmtCreate=" + gmtCreate +
        ", gmtModified=" + gmtModified +
        "}";
    }
}
